package com.lucifer.treasure.registry;

import com.lucifer.treasure.enchant.effect.*;
import net.minecraft.enchantment.effect.EnchantmentEntityEffect;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import com.mojang.serialization.MapCodec;

public class EnchantEffectRegistry {

    // 注册所有自定义附魔效果
    public static MapCodec<ExcavationEnchantmentEffect> EXCAVATION_EFFECT = register("excavation_effect", ExcavationEnchantmentEffect.CODEC);
    public static MapCodec<AutoSmeltEnchantmentEffect> AUTO_SMELT_EFFECT = register("auto_smelt_effect", AutoSmeltEnchantmentEffect.CODEC);
    public static MapCodec<MagnetEnchantmentEffect> MAGNET_EFFECT = register("magnet_effect", MagnetEnchantmentEffect.CODEC);
    public static MapCodec<StepEnchantmentEffect> STEP_EFFECT = register("step_effect", StepEnchantmentEffect.CODEC);
    public static MapCodec<ReachEnchantmentEffect> REACH_EFFECT = register("reach_effect", ReachEnchantmentEffect.CODEC);

    public static MapCodec<LifeLeechEnchantmentEffect> LIFE_LEECH_EFFECT = register("life_leech_effect", LifeLeechEnchantmentEffect.CODEC);
    public static MapCodec<BeheadingEnchantmentEffect> BEHEADING_EFFECT = register("beheading_effect", BeheadingEnchantmentEffect.CODEC);
    public static MapCodec<ExperienceBoostEnchantmentEffect> EXPERIENCE_BOOST_EFFECT = register("experience_boost_effect", ExperienceBoostEnchantmentEffect.CODEC);
    public static MapCodec<SteadyEnchantmentEffect> STEADY_EFFECT = register("steady_effect", SteadyEnchantmentEffect.CODEC);
    public static MapCodec<GrowthEnchantmentEffect> GROWTH_EFFECT = register("growth_effect", GrowthEnchantmentEffect.CODEC);
    public static MapCodec<DisarmEnchantmentEffect> DISARM_EFFECT = register("disarm_effect", DisarmEnchantmentEffect.CODEC);
    public static MapCodec<MultiBowEnchantmentEffect> MULTIBOW_EFFECT = register("multibow_effect", MultiBowEnchantmentEffect.CODEC);
    public static MapCodec<QuickdrawEnchantmentEffect> QUICKDRAW_EFFECT = register("quickdraw_effect", QuickdrawEnchantmentEffect.CODEC);
    public static MapCodec<MultiJumpEnchantmentEffect> MULTIJUMP_EFFECT = register("multijump_effect", MultiJumpEnchantmentEffect.CODEC);
    public static MapCodec<TravellerEnchantmentEffect> TRAVELLER_EFFECT = register("traveller_effect", TravellerEnchantmentEffect.CODEC);
    public static MapCodec<LastStandEnchantmentEffect> LASTSTAND_EFFECT = register("laststand_effect", LastStandEnchantmentEffect.CODEC);
    public static MapCodec<GloomCurseEnchantmentEffect> GLOOM_CURSE_EFFECT = register("gloom_curse_effect", GloomCurseEnchantmentEffect.CODEC);
    public static MapCodec<BeekeeperEnchantmentEffect> BEEKEEPER_EFFECT = register("beekeeper_effect", BeekeeperEnchantmentEffect.CODEC);
    public static MapCodec<EnderPearlEnchantmentEffect> ENDER_PEARL_EFFECT = register("ender_pearl_effect", EnderPearlEnchantmentEffect.CODEC);
    public static MapCodec<BlockReachEnchantmentEffect> BLOCK_REACH_EFFECT = register("block_reach_effect", BlockReachEnchantmentEffect.CODEC);

    private static <T extends EnchantmentEntityEffect> MapCodec<T> register(String id, MapCodec<T> codec) {
        return Registry.register(Registries.ENCHANTMENT_ENTITY_EFFECT_TYPE, Identifier.of("lucifer_treasure", id), codec);
    }

    public static void registerEnchantmentEffects() {
        // 初始化所有静态字段，触发注册
    }
} 